<?php
/**
 * Text element
 *
 */
class ArrowFormNumber extends ArrowFormField{

	
	public function configure(){
		parent::configure();	
		$this->addProperties(array(
			"length" => false,
			"rexp" => false
		));
	}	
	
	
	public function validate( $proposedValue ){

		if(empty($proposedValue) && !$this->getProperty("checkifempty") )
      return true;
      
		if(!is_numeric($proposedValue))
			return false;
		return true;
	}
	
	public function generateOutput(){
		$attribuites = array();
		$attribuites["name"] = $this->getHtmlName();
		$attribuites["value"] = str_replace("\"", "&quot;", $this->getValue()); //htmlentities(, ENT_QUOTES);

		return '<input type="text" '.$this->genTagsFromArray($attribuites).' '.$this->addExternal().' />';
	}


}
?>